<script lang="ts" setup>
	import { reactive, ref } from "vue";
	import {
		getCurrentInstance
	} from 'vue'
	import {
		useRouter
	} from 'uni-mini-router'
	import {
		onShow,
		onHide,
		onLoad,
		onReachBottom
	} from '@dcloudio/uni-app'
	import {
		userStore
	} from '@/pinia';
	const userStoreInfo = userStore();
	const {
		proxy,
	} = getCurrentInstance()
	const userRole = userStoreInfo.userFlag
	// console.log(userStoreInfo.userFlag);
	let router = useRouter()
	let pageNum = ref(1)
	let bzList = ref([])
	onReachBottom(() => {
		pageNum.value++
		getList()
	})
	const routerLink = (e) => {
		router.push({
			name: e
		})
	}
	let zongshu = ref();
	(() => {
		proxy.$req('GET', proxy.$api.bzjTongji, {}).then((res) => {
			console.log(res);
			zongshu.value = res.result
		})
	})();
	const getList = () => {
		proxy.$req('GET', proxy.$api.bzjList, {
			pageNo: pageNum.value,
			pageSize: 15
		}).then((res) => {
			console.log(res);
			bzList.value = bzList.value.concat(res.result.records)
		})
	}
	getList()
</script>
<template>
	<view class="container">
		<view class="maTop" @click="routerLink('editStoreInfo')">
			<view class="mam c-flex-center-center">
				<text>保证金（元）</text>
				<text style="font-size: 66rpx;font-weight: 600;" class="intFont">{{ zongshu }}</text>
			</view>
		</view>
		<view class="bzMoney" v-for="(item,index) in bzList" :key="index">
			<text>{{ item.categoryName }}</text>
			<view class="bmr intFont r-flex-center-center">
				<text style="margin-right: 16rpx;">￥{{ item.price }}</text>
			</view>
		</view>
	</view>
</template>
<style lang="scss">
	page {
		background-color: #fafafa;
	}

	view {
		box-sizing: border-box;
	}

	.container {
		width: 686rpx;
		padding: 0 30rpx;
		background: #FFFFFF;
		box-shadow: 8rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 24rpx;
		border: 2rpx solid #FFFFFF;
		margin: 30rpx auto 0;

		.maTop {
			width: 100%;
			// height: 150rpx;
			margin: 0rpx auto 0rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1rpx solid #e7e7e7;
			padding: 32rpx 0;

			.mam {
				width: 100%;

				text:nth-child(1) {
					font-size: 26rpx;
					color: #909399;
					margin-bottom: 15rpx;
				}
			}

		}

		.bzMoney {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx 0;
			font-weight: 600;

			.bmr {
				color: #909399;
				line-height: 30rpx;
			}
		}
	}
</style>